package com.ruoyi.web.domain.device;

import com.ruoyi.web.enums.DeviceTypeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Map;

@Data
public class DeviceNumber {

    @ApiModelProperty("墒情设备数量")
    private Long moisNum;

    @ApiModelProperty("灾情设备数量")
    private Long weaNum;

    @ApiModelProperty("杀虫灯设备数量")
    private Long killNum;

    @ApiModelProperty("虫情设备数量")
    private Long insectNum;

    @ApiModelProperty("病情设备数量")
    private Long sporeNum;

    @ApiModelProperty("病情设备数量")
    private Long seedingNum;

    public DeviceNumber(Map<String, Long> map){
        this.moisNum = map.get(DeviceTypeEnum.FL1.getValue());
        this.weaNum = map.get(DeviceTypeEnum.FL5.getValue());
        this.insectNum = map.get(DeviceTypeEnum.FL2.getValue());
        this.sporeNum = map.get(DeviceTypeEnum.FL3.getValue());
        this.seedingNum = map.get(DeviceTypeEnum.FL4.getValue());
        this.killNum = map.get(DeviceTypeEnum.KILL.getValue());
    }
}
